home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Controls
/
Visual Basic Controls.iso
/
vbcontrol
/
em7sui_1
/
em7sui~1.exe
/
frmGraphTest.fr_
/
frmGraphTest.fr
Wrap
Text File
|
1998-12-29
|
11KB
|
368 lines
VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.1#0"; "COMDLG32.OCX"
Object = "{056FF13B-7EE8-11D2-9507-A44605C12BC0}#1.1#0"; "VRAssist.ocx"
Object = "{23B2BD1E-7EF1-11D2-9507-A44605C12BC0}#1.1#0"; "VRAssist_GRAPH.ocx"
Begin VB.Form Form1
Caption = "VRAssist_GRAPH test"
ClientHeight = 3675
ClientLeft = 60
ClientTop = 390
ClientWidth = 7365
LinkTopic = "Form1"
ScaleHeight = 3675
ScaleWidth = 7365
StartUpPosition = 3 'Windows Default
Begin VRAssist_GRAPH.VRGraphCtl VRGraphCtl
Left = 6510
Top = 840
_ExtentX = 1085
_ExtentY = 1085
End
Begin VRAssist.VRAssistCtl VRAssistCtl
Left = 6510
Top = 120
_ExtentX = 1085
_ExtentY = 1085
End
Begin MSComDlg.CommonDialog dialog
Left = 6540
Top = 1590
_ExtentX = 847
_ExtentY = 847
_Version = 327680
End
Begin VB.PictureBox picColor
BackColor = &H00DADADA&
DrawWidth = 2
Height = 375
Index = 0
Left = 4410
ScaleHeight = 315
ScaleWidth = 315
TabIndex = 11
Top = 285
Width = 375
End
Begin VB.PictureBox picColor
BackColor = &H00B3D67E&
DrawWidth = 2
Height = 375
Index = 2
Left = 4395
ScaleHeight = 315
ScaleWidth = 315
TabIndex = 10
Top = 3000
Width = 375
End
Begin VB.PictureBox picColor
BackColor = &H00F0CC9B&
DrawWidth = 2
Height = 375
Index = 1
Left = 4410
ScaleHeight = 315
ScaleWidth = 315
TabIndex = 9
Top = 1530
Width = 375
End
Begin VB.TextBox txtValue
Height = 300
Index = 1
Left = 4380
TabIndex = 4
Top = 2610
Width = 1830
End
Begin VB.TextBox txtValue
Height = 300
Index = 0
Left = 4395
TabIndex = 2
Top = 1170
Width = 1830
End
Begin MSFlexGridLib.MSFlexGrid dataGrid
Height = 1050
Index = 0
Left = 90
TabIndex = 1
Top = 885
Width = 3945
_ExtentX = 6959
_ExtentY = 1852
_Version = 327680
Rows = 4
Cols = 4
FixedRows = 0
FixedCols = 0
AllowBigSelection= 0 'False
End
Begin VB.CommandButton Command1
Caption = "Run test"
Height = 315
Left = 105
TabIndex = 0
Top = 195
Width = 1305
End
Begin MSFlexGridLib.MSFlexGrid dataGrid
Height = 1035
Index = 1
Left = 90
TabIndex = 3
Top = 2355
Width = 3945
_ExtentX = 6959
_ExtentY = 1826
_Version = 327680
Rows = 4
Cols = 4
FixedRows = 0
FixedCols = 0
AllowBigSelection= 0 'False
End
Begin VB.Label Label1
Caption = "Chart grid"
Height = 255
Index = 4
Left = 4425
TabIndex = 12
Top = 45
Width = 1050
End
Begin VB.Label Label1
Caption = "Value"
Height = 255
Index = 3
Left = 4380
TabIndex = 8
Top = 2370
Width = 1050
End
Begin VB.Label Label1
Caption = "Value"
Height = 255
Index = 2
Left = 4395
TabIndex = 7
Top = 930
Width = 1050
End
Begin VB.Label Label1
Caption = "Data set B"
Height = 255
Index = 1
Left = 180
TabIndex = 6
Top = 2145
Width = 3405
End
Begin VB.Label Label1
Caption = "Data set A"
Height = 255
Index = 0
Left = 180
TabIndex = 5
Top = 675
Width = 3405
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Option Base 1
Dim m_world As Group
Dim m_mat(3) As Material
Dim m_colA(4) As em7_RoundedColumnSeries
Dim m_colB(4) As em7_RoundedColumnSeries
Private Sub Command1_Click()
Call GenerateFile
End Sub
Private Sub Form_Load()
Call PopulateGrids
Call CreateChart
End Sub
Private Sub dataGrid_EnterCell(Index As Integer)
txtValue(Index).Text = dataGrid(Index).Text
End Sub
Private Sub picColor_Click(Index As Integer)
dialog.Flags = cdlCCRGBInit Or cdlCCFullOpen
dialog.Color = picColor(Index).BackColor
dialog.ShowColor
picColor(Index).BackColor = dialog.Color
End Sub
Private Sub txtValue_Change(Index As Integer)
dataGrid(Index).Text = txtValue(Index).Text
End Sub
Private Sub txtValue_GotFocus(Index As Integer)
txtValue(Index).SelStart = 0
txtValue(Index).SelLength = Len(txtValue(Index).Text)
End Sub
Private Sub PopulateGrids()
Dim i, j As Integer
For i = 0 To 3
dataGrid(0).Row = i
dataGrid(1).Row = i
For j = 0 To 3
dataGrid(0).Col = j
dataGrid(1).Col = j
dataGrid(0).Text = 4 - i + j
dataGrid(1).Text = Format(Rnd * 8#, "0.00")
Next j
Next i
End Sub
Private Sub CreateChart()
Dim grid As em7_ChartGrid
Dim objApp(3) As Appearance
Dim transA(4) As Transform
Dim transB(4) As Transform
Dim protoRef As IExternProto
Dim nodeRef As IVRMLNode
Dim i As Integer
Dim curGap As Single
Dim objFactory As IVRMLFactory
Set objFactory = VRGraphCtl.Factory
' create the root of the scene
Set m_world = objFactory.CreateNode("Group")
' make the materials
For i = 1 To 3
Set objApp(i) = objFactory.CreateNode("Appearance")
Set m_mat(i) = objFactory.CreateNode("Material")
objApp(i).MaterialField.Value = m_mat(i)
Next i
'now create the chart grid
Set grid = objFactory.CreateNode("em7_ChartGrid")
Set protoRef = grid
protoRef.SourceFile = "..\..\..\ProtoPac\VR_GRAPH.wrl"
grid.AppearanceField.Value = objApp(1)
grid.XDimensionField.Value = 5
grid.XSpacingField.Value = 3
grid.YDimensionField.Value = 5
grid.YSpacingField.Value = 2
grid.ZDimensionField.Value = 5
grid.ZSpacingField.Value = 2
' add it to the scene
Call m_world.ChildrenField.AddValue(grid)
'create the two transform sets
curGap = 0.65
For i = 1 To 4
Set transA(i) = objFactory.CreateNode("Transform")
Set transB(i) = objFactory.CreateNode("Transform")
Call transA(i).TranslationField.SetValues(1.05, 0#, curGap)
Call transB(i).TranslationField.SetValues(1.95, 0#, curGap)
' add it to the scene
Call m_world.ChildrenField.AddValue(transA(i))
Call m_world.ChildrenField.AddValue(transB(i))
curGap = curGap + 2#
Next i
'create the two column sets
For i = 1 To 4
Set m_colA(i) = objFactory.CreateNode("